import { ref, watch, watchEffect } from "vue";

export default function(title = "不传就默认值") {
    const Title = ref(title);

    watch(Title, (newVal) => {
        document.title = newVal;
    }, {
        immediate: true   //立即执行
    })
    // watchEffect(() => {
    //     document.title = Title.value;
    // })


    return Title
}